#include <stdio.h>
#include <stdlib.h>

void chitalka(int n, int k)    
{
	int a[1000], i, j, g, p, nn, b;
for (i=0; i<n; i++)
	{
		a[i]=i+1;
	}
p=0; 
nn=n;
for (i=0; i<n-1; i++)
	{
		p=(p+(k%nn));
		if (p>nn)
			{
				p=p%nn;
			}
		nn=nn-1;
		
		printf("%d ", a[p-1]);
		
		p=p-1;

		for (j=p; j<nn; j++)
			{
				b=a[j];
                a[j]=a[j+1];
                a[j+1]=b;
			}
	}
 printf("winner ");
 